package caiziyou.com.designpattern.builder.improve;

public class HouseDirector {

	AbsHouseBuilder houseBuilder;

	public HouseDirector(AbsHouseBuilder houseBuilder) {
		this.houseBuilder = houseBuilder;
	}

	public void setHouseBuilder(AbsHouseBuilder houseBuilder) {
		this.houseBuilder = houseBuilder;
	}
	/**
	 * 建造流程交给指挥者
	 * @return
	 */
	public House constructHouse() {
		houseBuilder.buildBasic();
		houseBuilder.buildWalls();
		houseBuilder.roofed();
		return houseBuilder.buildHouse();
	}
}
